﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using EPS.Contracts;


namespace EPS.UI
{
    /// <summary>
    /// Interaction logic for Login.xaml
    /// </summary>
    public partial class Login : Window
    {
        public Login()
        {
            InitializeComponent();

            UserInfo userInfo = new UserInfo();
            userInfo.LoginName = "请输入用户名";
            this.DataContext = userInfo;
        }

        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            using (ServiceFactory<IUserInfo> factory = new ServiceFactory<IUserInfo>())
            {
                bool result = factory.GetProxy().CheckLogin(txtUserName.Text, txtPassword.Password);
                if (result)
                {
                    MessageBox.Show("验证成功!");
                }
            }
        }

        private void btnNO_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
